oldwd = getwd()
keep = ls()

#Set working directory
setwd('./data/indiana_soldiers')

############################
#Make Indiana Soldiers Data#
############################

# prepare Indiana soldiers for matching (restricted)
if (use_restricted) {
  source("./make/clean_indiana_soldiers.R")
}

# prepare census data for matching(restricted)
if (use_restricted) {
  source("./make/clean_indiana_census.R")
}


# prepare directory data for matching (public)
source("./make/clean_1874_directory.R")

# generate matches (public)
source("./make/make_indiana_matches.R")

# prepare Indiana soldier treatment data (restricted)
if (use_restricted) {
  source("./make/make_treatment_data.R")
}

# make/validate predicted partisanship (restricted)
if (use_restricted) {
  source("./make/make_predicted_partisanship.R")
}

# make census covariates (restricted)
if (use_restricted) {
  source("./make/make_census_covariates.R")  
}
    
#########
#Cleanup#
#########

rm(list = setdiff(ls(), c(keep, 'keep')))
setwd(oldwd)
  
